﻿
@model RonYee.Models.MvcPage

@{
    ViewBag.Title = "图书市场";
}
<script type="text/javascript">

    function getAjaxPageDate(CurrentPageIndex) {
        var dataStr = "CurrentPageIndex=" + CurrentPageIndex;
        $.ajax({
            type: "POST",
            url: "/Store/PageIndex",
            data: dataStr,
            contentType: "application/x-www-form-urlencoded;charset=UTF-8",
            async: false, // 同步  true 异步。默认是异步
            error: function (datas) {
                alert(datas);
            },
            success: function (data) {
                $('#content').html(data);
            }
        });
    }
</script>

 @using (Html.BeginForm("PageIndex", "Store", FormMethod.Post))
 { 
    <div id="breadcrumb">
        <a class="home" href="@Url.Action("Index", "Home")">Home</a>  &rsaquo; <a href="@Url.Action("Index", "Store")">Shop</a>
    </div>
    <h1 class="page-title">All Books</h1>
    <h2></h2>
    <ul class="products">
        @foreach (RonYee.Models.Book item in Model.BookList)
        {
            <li class="product border shadow">
            <a href="@Url.Action("Details", "Store", new { id = item.BookId })">
                <div class="thumbnail">
                    <img width="150" height="150" src="@Url.Content(item.BookImage)" class="attachment-shop_small wp-post-image" alt="@item.BookName" title="@item.BookName" />    			
                    <div class="thumb-shadow"></div>
                    <div style=" height:50px; width:140px;"><strong class="below-thumb">@item.BookName</strong></div>
                </div>
                <span class="price">价格： @item.CurrentPrice 库存： @item.BookCount </span>		
            </a>
            <div class="buttons">
                <a href="@Url.Action("Details", "Store", new { id = item.BookId })" class="details">DETAILS</a>&nbsp;
                <a href="@Url.Action("AddToCart", "ShoppingCart", new { id = item.BookId })" class="add-to-cart">ADD TO CART</a>
            </div>
            </li>
        }
    </ul>
    <div class="clear"></div>
     <center>@Html.Partial("~/Views/Shared/_PageIndex.cshtml", Model)</center>
 }



